package com.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.pojo.entity.Focus;
import com.pojo.vo.FocusVo;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface FocusMapper extends BaseMapper<Focus> {
    @Select("SELECT user_id, count(*) AS 'focusCount' from focus\n" +
            "group by user_id\n" +
            "ORDER BY focusCount DESC \n" +
            "LIMIT 0,20")
    List<FocusVo>selectFocusCount();
    @Select("SELECT focus_id, count(*) AS 'fansCount' from focus\n" +
            "group by focus_id\n" +
            "ORDER BY fansCount DESC \n" +
            "LIMIT 0,20")
    List<FocusVo>selectFansCount();

}
